﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading;

namespace PluginService
{
    public partial class PluginService : ServiceBase
    {
        protected static log4net.ILog _log = log4net.LogManager.GetLogger(typeof(PluginService));
        private FaceDeteiveServiceNamedPipeHelper _helper = new AddBlankBySocketAndPipeHelper();

        public PluginService()
        {
            InitializeComponent();
        }

        protected override void OnStart(string[] args)
        {
            _log.Info("Service Starting.....");
            Thread.Sleep(10000);
            try
            {
                _helper.Init();
                _helper.Start();
            }
            catch (Exception ex)
            {
                _log.Error(ex);
            }
                
            _log.Info("Service Started Suceess");
         
            
        }

        protected override void OnStop()
        {
            _helper.Dispose();
        }
    }
}
